Skip to content

[Backend Tester] Reduce log verbosity / spam #13312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: gh/GregoryComer/122/head
Choose a base branch
from

Conversation

GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Aug 12, 2025

When running tests, deprecation warnings for export_for_training and "internal consistency verification was requested but not available" create a large amount of spam in the CLI and drown out actual test info during the run. Neither warning is particularly useful. I've suppressed the the export_for_training warning in the backend tester only and switched the tester to not request internal consistency verification since it's not compiled into pybindings by default. This gives much cleaner CLI output.

Before:

test_add_dtype_float32_xnnpack_static_int8_per_channel (test_add.Add.test_add_dtype_float32_xnnpack_static_int8_per_channel) ... /home/gregory/src/executorch/src/executorch/backends/test/harness/stages/quantize.py:50: FutureWarning: `torch.export.export_for_training` is deprecated and will be removed in PyTorch 2.10. Please use `torch.export.export` instead, which is functionally equivalent.
  captured_graph = export_for_training(artifact, inputs, strict=True).module()
/home/gregory/miniconda3/envs/executorch/lib/python3.12/site-packages/torchao/quantization/pt2e/utils.py:818: FutureWarning: `torch.export.export_for_training` is deprecated and will be removed in PyTorch 2.10. Please use `torch.export.export` instead, which is functionally equivalent.
  aten_pattern = torch.export.export_for_training(
/home/gregory/miniconda3/envs/executorch/lib/python3.12/site-packages/torchao/quantization/pt2e/utils.py:818: FutureWarning: `torch.export.export_for_training` is deprecated and will be removed in PyTorch 2.10. Please use `torch.export.export` instead, which is functionally equivalent.
  aten_pattern = torch.export.export_for_training(
/home/gregory/miniconda3/envs/executorch/lib/python3.12/site-packages/torchao/quantization/pt2e/utils.py:818: FutureWarning: `torch.export.export_for_training` is deprecated and will be removed in PyTorch 2.10. Please use `torch.export.export` instead, which is functionally equivalent.
  aten_pattern = torch.export.export_for_training(
/home/gregory/miniconda3/envs/executorch/lib/python3.12/site-packages/torchao/quantization/pt2e/utils.py:818: FutureWarning: `torch.export.export_for_training` is deprecated and will be removed in PyTorch 2.10. Please use `torch.export.export` instead, which is functionally equivalent.
... (it logs like 20x per test)

After:

test_add_dtype_float32_xnnpack (test_add.Add.test_add_dtype_float32_xnnpack) ... ok
test_add_dtype_float32_xnnpack_static_int8_per_channel (test_add.Add.test_add_dtype_float32_xnnpack_static_int8_per_channel) ... ok
test_add_f32_alpha_xnnpack (test_add.Add.test_add_f32_alpha_xnnpack) ... ok
test_add_f32_alpha_xnnpack_static_int8_per_channel (test_add.Add.test_add_f32_alpha_xnnpack_static_int8_per_channel) ... ERROR
...

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Aug 12, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13312

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 New Failures

As of commit 780519f with merge base 3a02146 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: ffceed5
ghstack-comment-id: 3177730920
Pull-Request: #13312
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: ffceed5
ghstack-comment-id: 3177730920
Pull-Request: #13312
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: bbefbff
ghstack-comment-id: 3177730920
Pull-Request: #13312
@GregoryComer GregoryComer marked this pull request as ready for review August 12, 2025 06:12
@GregoryComer GregoryComer requested a review from cccclai as a code owner August 12, 2025 06:12
[ghstack-poisoned]
[ghstack-poisoned]
@@ -39,7 +40,9 @@ def graph_module(self) -> None:

def run_artifact(self, inputs):
inputs_flattened, _ = tree_flatten(inputs)
executorch_module = _load_for_executorch_from_buffer(self.buffer)
executorch_module = _load_for_executorch_from_buffer(
self.buffer, program_verification=Verification.Minimal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this do? i.e. Minimal ==> "do the verification but don't print warnings"?

@@ -249,6 +250,10 @@ def build_test_filter(args: argparse.Namespace) -> TestFilter:
def runner_main():
args = parse_args()

# Suppress deprecation warnings for export_for_training, as it generates a
# lot of log spam. We don't really need the warning here.
warnings.simplefilter("ignore", category=FutureWarning)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI PyTest has this nice feature where they count same warnings and at the end print warning summary https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants